#-*-coding:utf-8-*-
import sys
from PySide2.QtCore import *
from PySide2.QtWidgets import *

class MyProgressBar(QWidget):

    def __init__(self):
        super(MyProgressBar,self).__init__()
        self.setStyleSheet('background-color:rgb(75,75,75);color:rgb(200,200,200)')
        self.setWindowTitle('提交中...')
        self.setMinimumWidth(500)
        self.mainLayout=QVBoxLayout()
        self.mainLayout.setContentsMargins(15,12,15,15)
        self.tip_label=QLabel("进度：")
        self.tip_label.setAlignment(Qt.AlignCenter)
        self.progress_layout=QHBoxLayout()
        self.p=QProgressBar()


        self.mainLayout.addWidget(self.tip_label)
        self.mainLayout.addWidget(self.p)
        self.setLayout(self.mainLayout)

        # self.timer=QBasicTimer()
        # self.a=0
        # self.timer.start(10,self)
    def setValue(self,value):
        self.p.setValue(value)

    # def timerEvent(self, event):
    #     self.a+=0.1
    #     self.p.setValue(self.a)

if __name__ == '__main__':
    app=QApplication()
    p=MyProgressBar()
    p.show()
    sys.exit(app.exec_())